package adv328;
import adv327.Sex;
import adv327.Student;

import java.util.*;
/**
 * @author oldliu
 * @since 1.0
 */
public class ListDemo2 {
    public static void main(String[] args) {
        List list=new ArrayList();
        //???list.add("sss");
        list.add(new Student("刘1",23, Sex.妖));
        list.add(new Student("刘2",22, Sex.男));
        list.add(new Student("刘3",29, Sex.妖));

        Student s=new Student("刘1",34, Sex.女);
        boolean contains = list.contains(s);
        //依赖对象的contains方法：会用对象的Contains依次调用list中的对象
        //作为参数，只要有一个返回true,存在；其他false
        System.out.println("?"+contains);
    }
}
